import { request } from "../request";

const token = localStorage.getItem("token");

/**
 * 发送验证码接口返回结构
 */
export interface SendCodeRes {
    code: number;
    message: string;
    data: string;
    timestamp: Record<string, unknown>;
}

/**
 * 发送验证码
 * @param email 邮箱地址
 * @returns 发送结果
 */
export const sendVerificationCodeAPI = async (email: string): Promise<SendCodeRes> => {
    return request(`/api/verification/send?email=${email}`, {
        method: "post",
        headers: {
            "Content-Type": "application/x-www-form-urlencoded"
        },
    });
};